package com.mew.user.controller;

import com.mew.common.dc.mapper.FeedbackMapper;
import com.mew.common.entity.record.Feedback;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

@Controller
public class FeedbackController {

    @Autowired
    private FeedbackMapper feedbackMapper;

    @ResponseBody
    @RequestMapping("/feedback/{uid}/{msg}")
    public void feedback(@RequestParam("uid")long uid,@RequestParam("type")byte type,@RequestParam("msg") String msg){
        Feedback feedback = new Feedback();
        feedback.setType(type);
        feedback.setUserId(uid);
        feedback.setMsg(msg);
        feedback.setAddTime(new Date());
        feedbackMapper.insert(feedback);
    }
}
